<?php use_helper('Javascript') ?>
<?php echo link_to(image_tag($product->isInWatchlist() ? 'star.png' : 'watch.png'
                                    , array('border' => '0'
                                            , 'alt' => ucfirst(__('watch item'))
                                            , 'title' => ucfirst(__('watch item'))
                                            , 'id' => 'img_' . $product->getId()))
                            , '#'
                            , array( 'onclick' => 'onFromWatchlist(' . $product->getId() . ')'))?>

<script type="text/javascript">
function onFromWatchlist(id)
{
    jQuery.ajax({
        type: "post"
        , data: ({'id' : id, 'redir' : 1})
        , dataType: "html"
        , url: "/test.php/lt/product/removefromlist"
        , success: function(data) {
            jQuery('#watch_'+id).html(data)
          }
        , error: function() { console.debug("error"); }
    });
}
</script>
